ifneq ($(EXTERN_TEST_DIR),)
    TESTS_DIR:= $(EXTERN_TEST_DIR)
else
    #default tests directory
    TESTS_DIR:= $(CUR_DIR)/tests
endif

#此处不要减号'-'是为了强制检查目标目录是否有tests.mk
include $(TESTS_DIR)/tests.mk

-include $(foreach test_suite, $(test_suites), $(TESTS_DIR)/$(test_suite)/sources.mk)
T_C_SRC:= $(addprefix $(TESTS_DIR)/, $(test_c_srcs))
T_ASM_SRC:= $(addprefix $(TESTS_DIR)/, $(test_asm_srcs))
T_OBJS:= $(T_C_SRC:$(TESTS_DIR)/%.c=$(BUILD_DIR)/tests/%.o)


$(BUILD_DIR)/tests/%.o: $(TESTS_DIR)/%.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
